Skip to main content

Translation API

Endpoint:/translate

https://api.botlhale.xyz/translate

MethodPOST

This endpoint handles language translation, primarily to English, but can support translations to other target languages if specified.

tip

You need to include an Authentication Token in request headers. See the Authentication page of this documentation for information on how to generate authentication token codes.

Authentication

A valid Bearer token must be included in the request headers for authentication.

Headers:

  • Authorization: Bearer <your_token>

Form Arguments

This endpoint handles translations from the specified language to English, but can support translations to other target languages if specified.

Request ParamsData TypeDescription
TextstringRequiredThis is the text to be translated.
OrgIDstringRequiredThe unique identifier for the organization making the request.
TargetCodestringOptionalThe target language code for translation. Defaults to 'en-ZA' (English - South Africa).
TranslateIDstringOptionalA unique ID for the translation request, useful for fetching existing translations.
LanguageCodestringOptionalThe source language code of the text. If not provided, the API will attempt to detect the source language automatically.

Response

The API returns a JSON object with the following structure:

Unset
{
"Translation": "Translated text",
"DateReceived": "2025-01-28T10:00:00Z",
"Characters": 150,
"TranslateID": "abc123",
"detected_source_language": "fr"
}

Request ParamsData TypeDescription
TranslationstringThe translated text.
DateReceivedstringThe date and time when the request was received, in ISO 8601 format.
CharactersintegerThe number of characters in the source text.
TranslateIDstringThe unique ID of the translation request.
detected_source_languagestringThe detected source language of the text if language_code was not provided.

Endpoint:/translate/v2

Method:POST

This endpoint handles language translation, primarily to English, but can support translations to other target languages if specified.

Authentication

A valid Bearer token must be included in the request headers for authentication.

Headers:

  • Authorization: Bearer <your_token>
Request BodyFile TypeDescription
org_idStringRequiredThe unique identifier for the organization making the request.
textStringRequiredThe text to be translated.
language_codeStringOptionalThe source language code of the text. If not provided, the API will attempt to detect the source language automatically.
target_codeStringOptionalThe target language code for translation. Defaults to 'en-ZA' (English - South Africa).
translate_idStringOptionalA unique ID for the translation request, useful for fetching existing translations.

Response

Unset
{
"translation": "Translated text",
"date_received": "2025-01-28T10:00:00Z",
"characters": 150,
"translate_id": "abc123",
"detected_source_language": "fr"
}


Request ParamsData TypeDescription
translationstringThe translated text.
date_receivedstringThe date and time when the request was received, in ISO 8601 format.
charactersintegerThe number of characters in the source text.
translate_idstringThe unique ID of the translation request.
detected_source_languagestringThe detected source language of the text if language_code was not provided.

Supported Languages

The following table shows the languages Botlhale AI currently supports. The table also indicates the speech tasks supported for each language. Our team is always working to add new languages to the list.

LanguageRegionCodeTranslationASRTTSDiarizationLanguage ID
EnglishSouth Africaen-ZA
isiZuluSouth Africazu-ZA
isiXhosaSouth Africaxh-ZA
SesothoSouth Africast-ZA-
SetswanaSouth Africatn-ZA
SepediSouth Africanso-ZA
TshivendaSouth Africavr-ZA-
XitsongaSouth Africats-ZA-
AfrikaansSouth Africaaf-ZA
KiswahiliKenyasw-KE-
KinyarwandaRwandarw-RW---

Contact us

info

We are here to help! Please contact us with any questions.